package com.leetcode.LC;

public class LC1518 {
    public int numWaterBottles(int numBottles, int numExchange) {

        int count = numBottles;
        while (numBottles >= numExchange) {
            count += (numBottles / numExchange);
            numBottles = (numBottles % numExchange)+(numBottles / numExchange);
        }
        return count;
    }

    public static void main(String[] args) {
        System.out.println(new LC1518().numWaterBottles(9, 3));
    }
}
